{% extends "../templates/ajax/main_content_base.html" %} 
{% block intro %}{% endblock %}
{% block page_name %}homework_list{% endblock %}
{% block content %}


<div class="content-box">
	<div class="content-box-header">
		<h3>{{homework.name}}</h3>
	</div>
	<!-- End .content-box-header -->

	<div class="content-box-content">

		<div class="tab-content default-tab">

			<p>
			<h5 style="display:inline" >提交时间：</h5><span style="font-weight:bold;font-size:16px;color:red">{{homeworks_submited.0.homework_submited_info.last_updated_time|date:"Y年n月d日 ,G:i"}}</span>
			</p>
			
			<p>
				<h5 style="display:inline">作业类型：</h5>
				<span>
				{% ifequal homework.type 'personal'%}
					个人作业
				{% else %}
					小组作业
				{% endifequal %}
				</span>
			</p>
			<p>
			<h5  style="display:inline">下载源码：</h5><a class="src_url" href="{{homeworks_submited.0.homework_submited_info.src}}">点击下载</a>
			</p>
			<p>
			<h5 style="display:inline">部署地址：</h5><a class="deploy_url" href="{{homeworks_submited.0.homework_submited_info.url}}">点击访问</a>
			</p>
			<p>
			<h5 style="display:inline">应用截图：</h5>
			</p>
			<p><img class="pic_url" src="{{homeworks_submited.0.homework_submited_info.pic}}"/>
			
			
			
			
			
		</div>
		<!-- End #tab3 -->

	</div>
	<!-- End .content-box-content -->

</div>
<!-- End .content-box -->

<div class="content-box">
	<div class="content-box-header">
		<h3>提交历史</h3>
	</div>
	<!-- End .content-box-header -->

	<div class="content-box-content">

		<div class="tab-content default-tab">
	<table>
			<thead>
					<tr>
						<th>提交时间</th>
						<th>源码下载</th>
					</tr>

				</thead>

				<tfoot>
			
					<tr>
						<td colspan="4">
							<div class="clear"></div></td>
					</tr>
				</tfoot>

				<tbody>
				{% for homework_submited in homeworks_submited %}
					<tr id="{{homework_submited.homework_submited_info.id}}">	
						<td>{{homework_submited.homework_submited_info.last_updated_time|date:"Y年n月d日 ,G:i"}}</td>
						<td><a class="src_url" href="{{homework_submited.homework_submited_info.src}}">点击下载</a></td>		
					</tr>
				{% endfor %}
				</tbody>

			</table>
			
		</div>
		<!-- End #tab3 -->

	</div>
	<!-- End .content-box-content -->

</div>
<script type="text/javascript">
$.each($('.src_url'),function(index,obj){
	src_url = '{{request.settings.url_of_src_file}}'+$(obj).attr('href').replace('{{request.settings.root_path_of_src_file}}','')
	$(obj).attr('href',src_url)
});


$.each($('.pic_url'),function(index,obj){
	pic_url = '{{request.settings.url_of_homework}}'+$(obj).attr('src').replace('{{request.settings.root_path_of_homework}}','')
	$(obj).attr('src',pic_url)
});

$.each($('.deploy_url'),function(index,obj){
	deploy_url = '{{request.settings.url_of_homework}}'+$(obj).attr('href').replace('{{request.settings.root_path_of_homework}}','')+"/index.html"
	$(obj).attr('href',deploy_url)
});
//src = '%s%s'%(SettingDao.get_setting('url_of_src_file'),path[0].replace(SettingDao.get_setting('root_path_of_src_file'),''),)
</script>
<!-- End .content-box -->
{% endblock %}
